import {UP_AGE, UP_USERNAME} from "./actionType";

export default function(prevState,action){
    const state = JSON.parse(JSON.stringify(prevState));
    if(action.type === UP_USERNAME){
        state.userName = action.payload;
    }else if(action.type === UP_AGE){
        state.age = action.payload;
    }
    return state;
}